package com.celesea.auth.role.vo;

import com.celesea.auth.role.entity.RoleCode;
import com.celesea.auth.role.v1.controller.request.PageRequest;
import com.celesea.framework.dao.TenantFilterAdapter;
import com.celesea.framework.util.Const;
import com.celesea.framework.util.EnvUtil;

/**
 * @author JackYuan
 * @create 2017-10-26 23:40
 */
public class RoleFilter extends TenantFilterAdapter {
    private String company;
    private String keyword;
    private Byte statusFlag;
    private Byte deleteFlag;

    public RoleFilter(){
        super(EnvUtil.getTenantId());
        if(!EnvUtil.hasAnyRoles(RoleCode.ADMIN_SYSTEM)){
            this.company=EnvUtil.getCompany();
        }
        this.deleteFlag= Const.DeleteFlag.NORMAL;
    }

    public RoleFilter(PageRequest request) {
        this();
        this.keyword = request.getKeyword();
        this.statusFlag = request.getStatusFlag();
    }

    public String getKeyword() {
        return keyword;
    }

    public void setKeyword(String keyword) {
        this.keyword = keyword;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public Byte getStatusFlag() {
        return statusFlag;
    }

    public void setStatusFlag(Byte statusFlag) {
        this.statusFlag = statusFlag;
    }

    public Byte getDeleteFlag() {
        return deleteFlag;
    }

    public void setDeleteFlag(Byte deleteFlag) {
        this.deleteFlag = deleteFlag;
    }
}
